/<template>
	<view class="my-box">
		<NvaHeader title="个人中心"></NvaHeader>
		<view class="my-info">
			<image class="hedaer-img" src="../../../static/LOGO.png" mode=""></image>
			<view class="name">{{userInfo.username}}</view>
			<view class="company">{{userInfo.depName}}</view>
			<view class="phone">
				<u-icon name="phone"></u-icon>
				{{userInfo.phone}}
			</view>
		</view>
		<view class="box-item">
			<u-cell-group :border="false">
				<u-cell-item icon="lock" title="修改密码" @tap="editpasswordGoto"></u-cell-item>
				<u-cell-item icon="info-circle" title="投诉建议" @tap="adviseGoto"></u-cell-item>
				<u-cell-item icon="reload" title="检测更新" value="V1.0.1" @tap="update()"></u-cell-item>
				<u-cell-item icon="close-circle" @tap="outLogin()" title="退出登录" :border-bottom="false"></u-cell-item>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
	import header from '../../../components/header.vue';
	var _self;
	export default {
		data() {
			return {
				// 用户信息
				userInfo: ''
			};
		},
		components: {
			NvaHeader: header
		},
		onLoad() {
			_self = this;
			//获取用户信息
			_self.userInfo = uni.getStorageSync('user');
			console.log(this.userInfo)
		},
		methods: {
			outLogin() {
				uni.showModal({
					title:"退出登陆",
					content:"是否退出登陆",
					success: (res) => {
						if(res.confirm){
							uni.setStorageSync('password', "")
							this.$urlTo.Tip("退出成功")
							uni.reLaunch({
								url: '../../index/index'
							});
						} else {
							this.$urlTo.Tip("取消退出")
						}
					}
				})

			},
			update() {
				setTimeout(() => {
					uni.showToast({
						title: "当前已经是最新版本",
						icon: "none",
						duration: 2000
					})
				}, 500)
			},
			adviseGoto() {
				uni.navigateTo({
					url: "./advise/advise"
				})
				// setTimeout(() => {
				// 	uni.showToast({
				// 		title: "不允许投诉",
				// 		icon: "none",
				// 		duration: 2000
				// 	})
				// }, 500)

			},
			editpasswordGoto() {
				uni.navigateTo({
					url: "./editPassword/editPassword"
				})
			}
		}
	};
</script>

<style lang="scss" scoped>
	.my-box {
		background-image: url(../../../static/mybg.png);
		height: 100%;
		background-size: 100%;
	}

	.my-info {
		text-align: center;
		padding-top: 40rpx;

		.hedaer-img {
			width: 234rpx;
			height: 234rpx;
			background-color: #b1b8c8;
			border-radius: 117rpx;
			margin: auto;
		}

		.name {
			font-size: 50rpx;
			font-weight: normal;
			font-stretch: normal;
			line-height: 60rpx;
			letter-spacing: 2rpx;
			color: #ffffff;
			margin-top: 40rpx;
			font-weight: bold;
		}

		.company {
			font-size: 30rpx;
			font-weight: normal;
			font-stretch: normal;
			line-height: 60rpx;
			letter-spacing: 1px;
			color: #ffffff;
		}

		.phone {
			font-size: 36rpx;
			font-weight: normal;
			font-stretch: normal;
			line-height: 60rpx;
			letter-spacing: 1px;
			color: #ffffff;
		}
	}

	.box-item {
		width: 88%;
		background-color: #ffffff;
		border-radius: 10rpx;
		margin: auto;
		margin-top: 80rpx;
		padding: 0rpx 10rpx;
	}
</style>
